data=[0,1,2,3,2,1];
symbolRate=2;
carrierFreq=10;
freq_sep=8;
sampleFreq=40;
M=4;

DataConstel=fskmod(data,M,freq_sep,sampleFreq/symbolRate,sampleFreq,'discont');
% t = (0:length(DataConstel)-1)*carrierFreq/sampleFreq;
% carrier = exp(1i*(M*pi*t));
% signal = real(DataConstel).*real(carrier)+imag(DataConstel).*imag(carrier);
% 
% plot(signal)